function Classroom( students, teacher ) {
    // A private method used for display all the students in the class
    function disp() {
        // console.log( this.names.join(", ") );
        this.name = students.join(", ");
        console.log(typeof this.name);
    }

    var names = students.join(", ");

    // Store the class data as public object properties
    this.students = students;
    this.teacher = teacher;

    // Call the private method to display the error
    disp();

    this.getNames = function() {
    	return names;
    };
}

Classroom.prototype.getNames1 = function() {
	return this.students.join(", ");
};


// Create a new classroom object
var classRoom = new Classroom( [ "John", "Bob" ], "Mr. Smith" );

// Fails, as disp is not a public property of the object
//console.log(classRoom.dispName());

console.log(classRoom.getNames());
console.log(classRoom.getNames1());